<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box1{
      position: relative;
      width:400px;
      height: 400px;
      background-color: #bfa;
      transition-duration: 2s;
      transition-property: all;
    }
    .box1:hover>.box2{
      /* left: 700px; */
      transform:rotateY(90deg);
      transform: scale(0.5);
    }
    .box1:hover>.box3{
      /* left: 700px; */
    }
    .box3{
      transform: scale(0.5);
      transform: rotateZ(-4deg);
      transition-duration: 2s;
      transition-property: all;
      transition-timing-function: linear;
      position: absolute;
      width: 100px;
      height: 100px;
      background-color: red;
      left: 0px;
      top:120px;
    }
    .box2{
      transition-duration: 2s;
      transition-property: all;
      position: absolute;
      width: 100px;
      height: 100px;
      background-color: aqua;
      left: 0px;
      right: 0px;
      top: 0px;
      bottom: 0px;
      margin: auto;
    }
  </style>
</head>
<body>
  <div class="box1">
    <div class="box2"></div>
    <div class="box3"></div>
  </div>
</body>
</html>